package controllers

import (
	"github.com/astaxie/beego"
	"fmt"
"wcy-xmt-api/models"
)

// 直播页
type LivePageController struct {
	beego.Controller
}

// @Title 直播列表
// @Description 列表
// @Param app form int true "当前App编号"
// @Param size form int true "请求条目数"
// @Param current_page form int true "当前Page"
// @Success 200 {object} models.ResStatus
// @Success 200 {object} models.LiveInfo
// @router /list [post]
func (this *LivePageController) List() {
	fmt.Println("run LivePageController list")
	resStatus := &models.ResStatus{}
	liveInfo := &models.LiveInfo{}
	liveInfo.Code = 0
	liveInfo.Message = ""
	liveInfo.CurPage = 1
	liveInfo.Total = 10

	lives := []*models.Live{}
	live := &models.Live{}
	live.ActiveNum = 2323
	live.Title = "小米5发布会"
	live.SessionId = 001
	live.Type = 1
	live.ImageUrl = "http://img4.3lian.com/sucai/img6/230/29.jpg"
	lives = append(lives,live)

	live = &models.Live{}
	live.SessionId = 002
	live.Type = 2
	live.ActiveNum = 2323
	live.Title = "小米5发布会"
	live.ImageUrl = "http://img4.3lian.com/sucai/img6/230/29.jpg"
	lives = append(lives,live)

	live = &models.Live{}
	live.SessionId = 003
	live.Type = 3
	live.ActiveNum = 2323
	live.Title = "小米5发布会"
	live.ImageUrl = "http://img4.3lian.com/sucai/img6/230/29.jpg"
	lives = append(lives,live)

	live = &models.Live{}
	live.SessionId = 004
	live.Type = 4
	live.ActiveNum = 2323
	live.Title = "小米5发布会"
	live.ImageUrl = "http://img4.3lian.com/sucai/img6/230/29.jpg"
	lives = append(lives,live)

	live = &models.Live{}
	live.SessionId = 005
	live.Type = 4
	live.ActiveNum = 2323
	live.Title = "小米5发布会"
	live.ImageUrl = "http://img4.3lian.com/sucai/img6/230/29.jpg"
	lives = append(lives,live)

	liveInfo.Lives = lives

	resStatus.Code = 200
	resStatus.Data = liveInfo
	resStatus.ErrMsg = "OK"

	this.Data["json"] = resStatus
	this.ServeJson()
}